package com.sentrix.auto.printercenter.presentation.api.dto;

import com.sentrix.auto.printercenter.infrastructure.agentserver.dto.Uid;
import jakarta.validation.Valid;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.*;

@Data
public class PrintReqDto{
    @NotNull(message = "printerCode can't be null")
    private Long printerCode;
    private PrinterOptions options;
    @NotNull(message = "data can't be null")
    @Valid
    private PrintingData data;

    /**
     * {
     *     "bounds": null,
     *     "colorType": "color",
     *     "copies": 1,
     *     "density": 0,
     *     "duplex": false,
     *     "fallbackDensity": null,
     *     "interpolation": "bicubic",
     *     "jobName": null,
     *     "legacy": false,
     *     "margins": 0,
     *     "orientation": null,
     *     "paperThickness": null,
     *     "printerTray": null,
     *     "rasterize": false,
     *     "rotation": 0,
     *     "scaleContent": true,
     *     "size": null,
     *     "units": "in",
     *     "forceRaw": false,
     *     "encoding": null,
     *     "spool": null
     *   }
     */
    @Data
    public static class PrinterOptions {
        private String bounds;
        private String colorType;
        private int copies;
        private int density;
        private boolean duplex;
        private String fallbackDensity;
        private String interpolation;
        private String jobName;
        private boolean legacy;
        private int margins;
        private String orientation;
        private String paperThickness;
        private String printerTray;
        private boolean rasterize;
        private int rotation;
        private boolean scaleContent;
        private String size;
        private String units;
        private boolean forceRaw;
        private String encoding;
        private String spool;
    }

    /**
     * {
     *       "type": "pixel",
     *       "format": "pdf",
     *       "flavor": "file",
     *       "data": "http://192.168.21.2:8000/fff.pdf"
     *     }
     */
    @Data
    public static class PrintingData{
        @NotBlank(message = "type can't be empty")
        private String type;
        @NotBlank(message = "format can't be empty")
        private String format;
        @NotBlank(message = "flavor can't be empty")
        private String flavor;
        @NotBlank(message = "data can't be empty")
        private String data;
    }


}
